import java.util.Scanner;

public class Demo07 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String next = scanner.next();
        char[] chars = next.toCharArray();

        int zi = 0;
        int k = 0;
        int shu = 0;

        for (char aChar : chars) {
            if (aChar >= 'A' &&  aChar <= 'Z' || aChar >='a' && aChar <= 'z'){
                zi ++;
            }
            if (aChar == ' '){
                k ++;
            }
            if (aChar >= '0' && aChar <= '9'){
                shu ++;
            }

        }
        System.out.printf("%s %s %s %s",zi,k,shu,chars.length - zi - k - shu);
    }
}
